import FormBox from './FormBox'
import ModalForm from './ModalForm.vue'
import UploadFile from './Upload/UploadFile'
import ISelect from './Select.vue'
import ICheckbox from './Checkbox.vue'
import IRadio from './Radio.vue'

const components = {
  'form-box': FormBox,
  'modal-form': ModalForm,
  'upload-file': UploadFile,
  'i-select': ISelect,
  'i-checkbox': ICheckbox,
  'i-radio': IRadio
}

// eslint-disable-next-line func-names
const install = function (Vue) {
  Object.keys(components).forEach(key => {
    Vue.component(key, components[key])
  })
}

if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue)
}

// export default components
export default {
  install,
  ...components
}
